﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System.Diagnostics;

#endregion

namespace Sebarf.Diagnostics.Interfaces {
	/// <summary>
	/// Offers logging functionallity
	/// </summary>
	public sealed class Logger {
		#region Public Properties

		/// <summary>
		/// Gets or sets the check implementation
		/// </summary>
		public static ILoggerService LoggerImpl { get; set; }

		#endregion

		#region Public Methods

		/// <summary>
		/// resets the logger instance
		/// </summary>
		public static void ResetLoggerInstance() {
			LoggerImpl = new SimpleLoggerService();
		}

		/// <summary>
		/// writes a message with debug priority
		/// </summary>
		/// <param name="message"></param>
		[Conditional("DEBUG")]
		public static void WriteDebug(string message) {
			LoggerImpl.WriteLogEntry(0, message);
		}

		/// <summary>
		/// writes a message with information priority
		/// </summary>
		/// <param name="message"></param>
		public static void WriteInformation(string message) {
			LoggerImpl.WriteLogEntry(10, message);
		}

		/// <summary>
		/// writes a message with warning priority
		/// </summary>
		/// <param name="message"></param>
		public static void WriteWarning(string message) {
			LoggerImpl.WriteLogEntry(100, message);
		}

		/// <summary>
		/// writes a message with error priority
		/// </summary>
		/// <param name="message"></param>
		public static void WriteError(string message) {
			LoggerImpl.WriteLogEntry(1000, message);
		}

		#endregion

		#region Private Methods

		/// <summary>
		/// static ctr
		/// </summary>
		static Logger() {
			ResetLoggerInstance();
		}

		/// <summary>
		/// private ctr
		/// </summary>
		private Logger() {
		}

		#endregion
	}
}